import dataAccess from './data_access'


//获取文章列表
function getArticles(param, callback) {
  param.scene = 1;
  //调用远程接口获得结果
  dataAccess.rpcGet({
    url: 'homelist',
    param: param,
    success: function (rsFromRpc) {
      callback(rsFromRpc);
    }
  });
}

function detail(param, callback) {
  param.scene = 1;
  //调用远程接口获得结果
  dataAccess.rpcGet({
    url: 'articleDetail',
    param: param,
    success: function (rsFromRpc) {
      callback(rsFromRpc);
    }
  });
}

//加载专辑
function getAlbums(param, callback) {
  param.scene = 1;
  //调用远程接口获得结果
  dataAccess.rpcGet({
    url: 'albums',
    param: param,
    success: function (rsFromRpc) {
      callback(rsFromRpc);
    }
  });
}

//加载专辑详情
function albumDetail(param, callback) {
  param.scene = 1;
  //调用远程接口获得结果
  dataAccess.rpcGet({
    url: 'albumDetail',
    param: param,
    success: function (rsFromRpc) {
      callback(rsFromRpc);
    }
  });
}


//暴露js接口给其它js
module.exports = {
  getArticles, getAlbums, albumDetail, detail
}